At the end of 2019, a novel coronavirus was identified as the cause of a cluster of pneumonia cases in China. It rapidly spread, resulting in an epidemic throughout the world. In February 2020, the World Health Organization designated the disease COVID-19, which stands for coronavirus disease 2019. This report is designed to explore the association beween Covid-19 death and state, age groups.
The data was obstained from the US CDC, Centers of Disease Control and Prevention. The date include deaths involving coronavirus disease 2019 (COVID-19), pneumonia, and influenza reported to NCHS by sex and age group and state.
We calculate the proportionate mortality ratio due to COVID-19 by using the COVID-19 deaths/total deaths.
library(data.table)
library(dtplyr)
library(dplyr)
library(leaflet)
library(tidyverse)
library(ggplot2)
covid = fread("data/Provisional_COVID-19_Death_Counts_by_Sex__Age__and_State.csv")
#calculate proportionate mortality ratio due to COVID-19
covid$PMR=covid$`COVID-19 Deaths`/covid$`Total Deaths`
Here, we create a map of proportionate mortality ratio among the states.
covid_state=covid[which(covid$Sex == "All Sexes" & covid$State != "United States" & covid$`Age group`=="All Ages"),]
#covid_state$State[which(covid_state$State %in% states$NAME ==F)]
covid_state[33,7:12]=covid_state[33,7:12]+covid_state[34,7:12]
covid_state=covid_state[-34, ]
covid_state$PMR=covid_state$`COVID-19 Deaths`/covid_state$`Total Deaths`
colnames(covid_state)[4]="NAME"
mergedata=merge(x = states, y = covid_state, by = "NAME", all.x = TRUE)
pal <- colorBin("YlOrRd", domain = mergedata$PMR)
leaflet() %>%
addProviderTiles("CartoDB.Positron") %>%
setView(-98.483330, 38.712046, zoom = 4) %>%
addPolygons(
data=mergedata,
fillColor = ~pal(mergedata$PMR),
fillOpacity = 0.7,
weight = 0.2,
smoothFactor = 0.2
)%>%
addLegend(pal = pal,
values = mergedata$PMR,
position = "bottomright",
title = "PMR")
Here we can see that the New York State has the highest proportionate mortality ratio due to COVID-19. It means that New York City has the most people died because of Covid-19.
pal2 <- colorBin("YlOrRd", domain = mergedata$`COVID-19 Deaths`)
leaflet() %>%
addProviderTiles("CartoDB.Positron") %>%
setView(-98.483330, 38.712046, zoom = 4) %>%
addPolygons(
data=mergedata,
fillColor = ~pal2(mergedata$`COVID-19 Deaths`),
fillOpacity = 0.7,
weight = 0.2,
smoothFactor = 0.2
)%>%
addLegend(pal = pal2,
values = mergedata$`COVID-19 Deaths`,
position = "bottomright",
title = "Total Deaths")